'use strict';

module.exports = () => {
  const config = exports = {};
  config.cluster = {
    listen: {
      port: 9100,
    },
  };

  config.manager = ['1000'];
  // 登录配置
  config.zconnect = {
    serverHost: 'http://connect.songyan.asia',
    zeehub    : {
      appId      : 'xIuP9QJtZSPZ',
      secret     : 'aIIc86PUcpsc',
      redirectUri: 'http://connect.songyan.asia/callback',
      publicKey  : '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfsZJvCkFShEbI+ZDQ4f5SUi8u\nFPTWJIFopXVL2i32+0XfZVaOtpskVXkJb4wJnqGfILDwnjVv9nxekKbo2Zd04Bxl\nHUjkBvO1vfhfytwS3qZzHCPQWxE/+/iLmKXLNz+tJ7yeZSEJQ7CHA0CfX2UwzxX2\nOWPtiHPaK1He3k7EZQIDAQAB\n-----END PUBLIC KEY-----',
    },
  };
  config.alinode = {
    logdir: '/root/logs/alinode',
  };
  // 数据库配置
  config.sequelize = {
    dialect : 'mysql', // support: mysql, mariadb, postgres, mssql
    database: 'zeeephrback',
    host    : 'localhost',
    port    : 3306,
    username: 'root',
    password: 'mysql',
    version : 1,
  };
  // 对/oidc/接口进行忽略
  config.security = {
    csrf: {
      ignore: ctx => {
        return (/(\/oidc\/.*)/).test(ctx.path);
      },
    },
  };
  config.logger = {
    dir: 'local-to-server-log/logs',
  };
  return {
    ...config,
  };
};
